Product Code Database
Example Keywords: ipad -dress $10
   » » Wiki: Call Site
Tag Wiki 'Call Site'.
Tag

Call site
 (

 C O N T E N T S 

In programming, a call site of a function or subroutine is the location (line of code) where the function is called (or may be called, through ). A call site is where zero or more arguments are passed to the function, and zero or more are received.


Example
// this is a function ''definition''
function sqr(x)
{
  return x * x;
}
     
function foo() {
  // these are two call sites of function sqr in this function
  a = sqr(b);
  c = sqr(b);
}
     


Assembler example
IBM/360 or Z/Architecture
* (usually) external call.... R13 usually points to a save area for general purpose registers beforehand
*                         and R1 points to a list of addresses of parameters (if any)
        LA    R1,=A(B)         point to (address of) variable 'B'
        L     R15,=A(SQR)      Load pointer (address constant) to separately compiled/assembled subroutine
        BALR  R14,R15          Go to subroutine, which returns - usually at zero displacement on R14
* internal call            (usually much smaller overhead and possibly 'known' parameters)
        BAL   R14,SQR          Go to program label and return
     
In some occasions, is an efficient method of indicating success or failure. may be accomplished by returning at +0 or +4,+8, +12, etc. requiring code, for example a small , at the return point - to go directly to process the case (as in HLL ).
        BAL   R14,SQR          Go to program label and return (using offset on R14 as return address)
        B     OK               (RET+0) - O.K
*                              (RET+4) - Failure
     
Conventionally however, a code is set in R15 (0=OK, 4= failure, or similar ..) but requiring a separate instruction to test R15 or use directly as a branch index.


See also

Page 1 of 1
1
Page 1 of 1
1

Account

Social:
Pages:  ..   .. 
Items:  .. 

Navigation

General: Atom Feed Atom Feed  .. 
Help:  ..   .. 
Category:  ..   .. 
Media:  ..   .. 
Posts:  ..   ..   .. 

Statistics

Page:  .. 
Summary:  .. 
1 Tags
10/10 Page Rank
5 Page Refs
1s Time